package net.tngou.c4j.ik;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;

import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;

public class Test {

	public static void main(String[] args) {
		String input="IK Analyzer是2017-10-21结合123词典分词和文法分词的中文分词开源工具包。它使用了全新的正向迭代最细粒度切分算法。";
		Reader reader = new StringReader(input);
		IKSegmenter segmenter = new IKSegmenter(reader , true);
		Lexeme lexeme=null;  
        try {
			while((lexeme=segmenter.next())!=null){  
				System.err.print(lexeme.getLexemeText()+"|");
				
			}
        } catch (IOException e) {
			e.printStackTrace();	
		}
	}
}
